﻿using Ledict.ConditionExtract.Base;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Ledict.ConditionExtract.Frm.NodeTree
{
    public partial class MoveState : BaseForm
    {
        public MoveState(string dragNodeName,string dropNodeName)
        {
            InitializeComponent();
            label3.Text = dragNodeName;
            label4.Text = dropNodeName;
        }
        public string moveNodeState = string.Empty;
        public bool LevelShow { get; set; }

        private void MoveState_Load(object sender, EventArgs e)
        {
            if (LevelShow)
            {
                btnLowLevel.Enabled = false;
            }
            else
            {
                btnLowLevel.Enabled = true;
            }
        }

        /// <summary>
        /// 上方
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnUp_Click(object sender, EventArgs e)
        {
            moveNodeState = "上方";
            DialogResult = DialogResult.Yes;
            this.Close();
        }

        /// <summary>
        /// 下方
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnDown_Click(object sender, EventArgs e)
        {
            moveNodeState = "下方";
            DialogResult = DialogResult.Yes;
            this.Close();
        }

        /// <summary>
        /// 下级
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLowLevel_Click(object sender, EventArgs e)
        {
            moveNodeState = "下级";
            DialogResult = DialogResult.Yes;
            this.Close();
        }

        private void MoveState_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult = DialogResult.Cancel;
        }
       
    }
}
